﻿#ifndef __BULLET_H__
#define __BULLET_H__
#include"Articles.h"
#include<QVector2D>
//子弹
class Bullet :public Articles
{
public:
    Bullet()=default;
    Bullet(int x, int y, QObject* parent=nullptr);
    Bullet(QPoint point, QObject* parent=nullptr);
    virtual ~Bullet()=default;
    virtual void init();
    virtual void update()override;
    //自动移动
    void AutoMove();
    //设置自动移动属性,方向和步长(一秒距离),
    void setProperty(const QVector2D& vector=QVector2D(0,1), const int Steplength=500);
    //碰撞器检查
    virtual bool Collider(const QRect& collider);
    virtual bool Collider(Articles& collider);
    //获取伤害
    const int getHarm();
protected:
    int m_Steplength = 30;//步长
    QVector2D m_vector;//方向向量
    qreal m_SumLen = 0;//累计步长

    int ATK = 1;//攻击
private:
    
};
#endif // !__BULLET_H__